package com.mouse.magent.web.controller;


import com.mouse.magent.common.entity.common.Result;
import com.mouse.magent.web.entity.pr.LoginPr;
import com.mouse.magent.web.entity.vo.LoginVo;
import com.mouse.magent.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/auth")
public class AuthController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public Result<LoginVo> login(@Valid LoginPr loginPr) {
        return Result.success(userService.login(loginPr));
    }
}
